@extends('layouts.home.layout')
@section('content')
    @include('layouts.home._nav')
    
    <div class="calc-entry" style="margin-top: 20px;">
        <ul class="am-cf">
            <li class="ce-li cel1"><a href="/main/mortgage">购房贷款工具</a></li>
            <li class="ce-li cel2"><a href="/main/card">信用卡分期</a></li>
            {{--<li class="ce-li cel3"><a href="/main/evaluate">贷款能力评估</a></li>--}}
            <li class="ce-li cel4 cur"><a href="/apply/cardstepone">信用卡快捷推荐</a></li>
        </ul>
    </div>

    <div class="financial">
        <div class="financial_top">
            <div class="financial_title">
                <img src="{{asset('home')}}/images/jrlogz_03.jpg" />
                <div>
                    <h1>信用卡快捷推荐</h1>
                    <p>轻松办卡快速拿卡</p>
                </div>
            </div><!--financial_title-->
        </div><!--financial_top-->

        <div class="jrbz"><img src="{{asset('home')}}/images/bz2_03.jpg" width="831" height="39" /></div>
        <form action="{{url('apply/cardsteptwo')}}" name="twoForm" id="twoForm" method="post">
            <input type="hidden" name="recordid" value="{{$recordid}}">
        <div class="yzbox">
            <p>您的年龄</p>
            <div class="yzinput_box">
                <input  placeholder="" name="age" class="yzbox_input"/>
                <p>岁</p>
            </div>
        </div>
        <div class="yzbox">
            <p>工作单位性质</p>
            <select class="yzselect" name="job">
                <option value="">请选择</option>
                <option value="企业">企业</option>
                <option value="事业单位">事业单位</option>
                <option value="国家行政机关">国家行政机关</option>
            </select>
        </div>
        <div class="yzbox">
            <p>月收入范围</p>
            <select class="yzselect" name="salary">
                <option value="">请选择</option>
                <option value="5000以下">5000以下</option>
                <option value="5000~1万">5000~1万</option>
                <option value="1万~5万">1万~5万</option>
                <option value="5万以上">5万以上</option>
            </select>
        </div>
        <div class="yzbox">
            <p>是否有房</p>
            <div class="radiobox" style="border:none;">
                <input type="radio" name="is_house" value="1" class="xianjin"/><p>有</p>
                <input type="radio" name="is_house" value="0" class="chuxuka"/><p>没有</p>
            </div>
        </div>
        <div class="yzbox">
            <p>是否有车</p>
            <div class="radiobox" style="border:none;">
                <input type="radio" name="is_car" value="1" class="xianjin"/><p>有</p>
                <input type="radio" name="is_car" value="0" class="chuxuka"/><p>没有</p>
            </div>
        </div>
        <div class="yzbox">
            <p>是否有社保</p>
            <div class="radiobox" style="border:none;">
                <input type="radio" name="is_social" value="1" class="xianjin"/><p>有</p>
                <input type="radio" name="is_social" value="0" class="chuxuka"/><p>没有</p>
            </div>
        </div>
        <div class="yzbox">
            <p>是否有公积金</p>
            <div class="radiobox" style="border:none;">
                <input type="radio" name="is_fund" value="1" class="xianjin"/><p>有</p>
                <input type="radio" name="is_fund" value="0" class="chuxuka"/><p>没有</p>
            </div>
        </div>
        <div class="yzbox">
            <p>申请额度</p>
            <select class="yzselect" name="fee">
                <option value="">请选择要申请的额度</option>
                <option value="1万">1万</option>
                <option value="5万">5万</option>
                <option value="10万">10万</option>
                <option value="20万">20万</option>
            </select>
        </div>
        <button type="button" class="nextbtn subBtn" style="margin-top:30px;">下一步</button>
        </form>
    </div><!--financial-->




    <script>
        var regionurl="{{url('main/region')}}";
        $('.provinces_select').change(function(){
            var code=$(this).val();
            $.post(regionurl,{code:code},function(result){
                $('.city_select').html(result)
            })
        });

        //同意
        $('.isagree').change(function(){
            if($('.isagree').is(':checked')==true){
                $('.subBtn').attr('disabled',false)
            }else{
                $('.subBtn').attr('disabled',true)
            }
        })
        $(document).ready(function () {
            var twooptions = {
                success: function (data) {
                    $(".subBtn").attr('disabled',false);
                    layer.msg(data.message);
                    if(data.code=='0000'){
                        window.location.href="{{url('apply/cardstepthree')}}"+'?recordid='+data.recordid;
                    }
                }
            };
            $(".subBtn").click(function () {
                var fm=document.forms['twoForm'];// HTML DOM 通过form 元素的name值获取
                if(fm.age.value==''){
                    layer.msg('请填写年龄');
                    return false;
                }
                if(fm.job.value==''){
                    layer.msg('请选择工作单位性质');
                    return false;
                }
                if(fm.salary.value==''){
                    layer.msg('请选择月收入范围');
                    return false;
                }
                if(fm.is_house.value==''){
                    layer.msg('请选择是否有房');
                    return false;
                }
                if(fm.is_car.value==''){
                    layer.msg('请选择是否有车');
                    return false;
                }
                if(fm.is_social.value==''){
                    layer.msg('请选择是否有社保');
                    return false;
                }
                if(fm.is_fund.value==''){
                    layer.msg('请选择是否有公积金');
                    return false;
                }
                if(fm.fee.value==''){
                    layer.msg('请选择要申请的额度');
                    return false;
                }


                $(".subBtn").attr('disabled',true);//禁用按钮
                $("#twoForm").ajaxSubmit(twooptions);
            });
        });
    </script>
@endsection
